using System;
using System.Collections.Generic;
using System.Text;

namespace Sedna.Core.AppConfig
{
    public class AppConfigurationHolder: ConfigurationHolder
    {
        /// <summary>
        /// Returns true if total allocated balance can exceed parent customer balance.
        /// </summary>
        /// <returns></returns>
        public static bool IsParentBalanceExceed()
        {
            return GetBooleanParameterValue("allowParentBalanceExceed");
        }
        
        /// <summary>
        /// Returns maximum amount of unsuccessful login attempts
        /// </summary>
        /// <returns></returns>
        public static int MaxLoginFailureAttempts()
        {
            return GetIntParameterValue("maxLoginFailureAttempts");
        }

        /// <summary>
        /// Returns timeout of users garbage collection (to delete inactive sessions, e.g. if user was inactive during particular amount of time then its session should be closed and user has to relogin to the System to continue working)
        /// </summary>
        /// <returns></returns>
        public static int LoginGarbageCollectionTimeout()
        {
            return GetIntParameterValue("gc.timeout");
        }

        /// <summary>
        /// Returns maximum amount of time during which user can be inactive (do not send any requests to server)
        /// </summary>
        /// <returns></returns>
        public static int LoginTimeout()
        {
            return GetIntParameterValue("login.timeout");
        }
        /// <summary>
        /// Returns current build number
        /// </summary>
        /// <returns></returns>
        public static string BuildNumber()
        {
            return GetParameterValueByName("buildnumber");
        }
        
        public static string AllerEmailFrom()
        {
            return GetParameterValueByName("alertEmailFrom");
        }

        public static string AllerEmailTo()
        {
            return GetParameterValueByName("alertEmailTo");
        }
    }
}
